﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NTTDATA.BEENChina.ResultCertification.Client.Entry.Logic;

namespace NTTDATA.BEENChina.ResultCertification.Client.Entry.Model
{
    public class Page
    {

        /// <summary>
        /// SEQNo
        /// </summary>
        public string SEQNo { get; set; }

        /// <summary>
        /// 图片内容
        /// </summary>
        public JobImage Image { get; set; }
        /// <summary>
        /// 答案
        /// </summary>
        public JobAnswer Answer { get; set; }
        /// <summary>
        /// 总字数
        /// </summary>
        public int WordCount { get; set; }
        /// <summary>
        /// 错误字数
        /// </summary>
        public int ErrWordCount { get; set; }
        /// <summary>
        /// 履历
        /// </summary>
        public CurriculumViitae JobCurriculumViitae { get; set; }

        public string getResultCount(string vValue)//统计入力数
        {
            if (string.IsNullOrEmpty(vValue) == false)
            {
                string[] s = splitstring(vValue, "/");
                int iTemp = 0;
                for (int i = 0; i < s.Length; i++)
                {
                    iTemp = iTemp + s[i].Length;
                }
                return iTemp.ToString();
            }
            else
            {
                return "0";
            }
        }
        private string[] splitstring(string readline)
        {
            string[] stringSeparators = new string[] { "\\\\", "\r\n" };
            return readline.Split(stringSeparators, StringSplitOptions.None);
        }
        private string[] splitstring(string readline, string vValue)
        {
            string[] stringSeparators = new string[] { "\\\\", "\r\n", vValue };
            return readline.Split(stringSeparators, StringSplitOptions.None);
        }


        public string FoldlineFun(string strTxt)
        {
            string[] bb = splitstring(strTxt);
            string line = string.Empty;
            for (int i = 0; i < bb.Length; i++)
            {
                if (i == bb.Length - 1)
                    line += bb[i];
                else
                    line += bb[i] + Environment.NewLine;
            }
            return line;
        }
    }
}
